#{extends 'admin.html' /}
#{set title:'Faire une demande de formation' /}
<article class="module width_full">
    <header><h3 class="tabs_involved">Faire une demande de formation</h3>
        <ul class="tabs">
            <li><a href="@{Admin.index}">Annuler</a></li>
        </ul>
    </header>
    #{form @send(), id:'createForm'}
    <div class="module_content">
        <fieldset>
            <label>Formation désirée ? </label>
            <select name="entity.formationtype.id">


                %{ models.FormationType.all().fetch().sort{ it.toString() }.each() { }%

                %{
                selected = false;
                if (entity?.formationtype?.id == it.id) {
                selected = true
                }
                }%
                <option value="${it?.id}" ${selected ? 'selected'.raw() : ''}>${it}</option>
                %{ } }%
            </select>
            
        </fieldset>

            <div class="submit_link">
                <input type="submit" name="submit" value="Envoyer" class="alt_btn"/>
            </div>

        #{/form}
    </div>
</article>

